package com.oahcfly.chgame.egret.ui;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Json;

public class FntParser {

	// {"file":"snum.png","frames":{
	// "0":{"x":1,"y":1,"w":20,"h":24,"offX":2,"offY":0},
	// "1":{"x":106,"y":1,"w":11,"h":24,"offX":6,"offY":0},
	// "2":{"x":45,"y":1,"w":19,"h":24,"offX":2,"offY":0},
	// "3":{"x":86,"y":1,"w":18,"h":24,"offX":4,"offY":0},
	// "4":{"x":1,"y":27,"w":20,"h":24,"offX":2,"offY":0},
	// "5":{"x":66,"y":27,"w":18,"h":24,"offX":3,"offY":0},
	// "6":{"x":45,"y":27,"w":19,"h":24,"offX":2,"offY":0},
	// "7":{"x":66,"y":1,"w":18,"h":24,"offX":3,"offY":0},
	// "8":{"x":23,"y":1,"w":20,"h":24,"offX":2,"offY":0},
	// "9":{"x":23,"y":27,"w":20,"h":24,"offX":2,"offY":0}}}
	public FntParser(String path) {

		FileHandle fileHandle = Gdx.files.internal(path);
		Json json = new Json();
		json.fromJson(Fnt.class, fileHandle);
	}

	class Fnt {
		private String file;
		private String frames;

		public String getFile() {
			return file;
		}

		public void setFile(String file) {
			this.file = file;
		}

		public String getFrames() {
			return frames;
		}

		public void setFrames(String frames) {
			this.frames = frames;
		}

	}
}
